package com.yds.ydsdatasetbackend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yds.ydsdatasetbackend.model.dto.file.FileEditRequest;
import com.yds.ydsdatasetbackend.model.dto.file.FileQueryRequest;
import com.yds.ydsdatasetbackend.model.dto.file.FileUploadRequest;
import com.yds.ydsdatasetbackend.model.entity.File;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yds.ydsdatasetbackend.model.entity.User;
import com.yds.ydsdatasetbackend.model.vo.FileVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author YDS
* @description 针对表【file(数据文件)】的数据库操作Service
* @createDate 2025-01-31 12:05:39
*/
public interface FileService extends IService<File> {

    /**
     * 校验文件
     *
     * @param file
     */
    void validFile(File file);

    /**
     * 上传图片
     *
     * @param inputSource
     * @param fileUploadRequest
     * @param loginUser
     * @return
     */
    FileVO uploadFile(Object inputSource,
                         FileUploadRequest fileUploadRequest,
                         User loginUser);

    FileVO getFileVO(File file, HttpServletRequest request);

    Page<FileVO> getFileVOPage(Page<File> filePage, HttpServletRequest request);

    QueryWrapper<File> getQueryWrapper(FileQueryRequest fileQueryRequest);

    void editFile(FileEditRequest fileEditRequest, User loginUser);

    void checkFileAuth(User loginUser, File file);

    void deleteFile(long fileId, User loginUser);

}
